import 'package:flutter/material.dart';
// import './map/my_demo_localizations.dart';
import './intl/my_demo_localizations.dart';

class I18NDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    Locale locale = Localizations.localeOf(context);

    return Scaffold(
      appBar: AppBar(
        title: Text("I18NDemo"),
        elevation: 0.0,
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text('${locale.toString()}'), // 显示当前本地化配置
            SizedBox(height: 16.0),
            Text(
              // Localizations.of(context, MyDemoLocalizations).title,
              MyDemoLocalizations.of(context).title,
              style: TextStyle(
                fontSize: 20.0,
                fontWeight: FontWeight.bold,
              ),
            ),
            SizedBox(height: 16.0),
            Text(
              // Localizations.of(context, MyDemoLocalizations).title,
              MyDemoLocalizations.of(context).greet("大哥"),
              style: TextStyle(
                fontSize: 20.0,
                fontWeight: FontWeight.bold,
              ),
            )
          ],
        ),
      ),
    );
  }
}